<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/styles.css') }}">
    <title>{% block title %}Flask App{% endblock %}</title>
  </head>
  <body>
    <!-- Header -->
    <header>
      <nav class="navbar navbar-expand-md navbar-light bg-light">
        <a class="navbar-brand" href="{{ url_for('index')}}">YOUER的电子公文系统</a>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarNav">
            <ul class="navbar-nav">
                <li class="nav-item">
                    <a class="nav-link" href="{{url_for('document')}}">公文查找</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="{{url_for('document_add')}}">公文起草</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="{{url_for('document_audit_list')}}">公文审核</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="{{url_for('document_receipt_list')}}">公文签收</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="{{url_for('user_list')}}">用户管理</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="{{url_for('permission_manage')}}">权限管理</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="{{url_for('log_view')}}">安全管理</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="{{url_for('about')}}">关于作者</a>
                </li>
            </ul>
        </div>
      </nav>
    </header>

    <!-- Main Content -->
    <main class="container mt-4">
      <div class="content-container">
          {% block content %}
          {% endblock %}
      </div>
    </main>

    <!-- Flash Messages at the bottom -->
    <footer class="mt-4">
      <div class="flashes-container container">
          {% with messages = get_flashed_messages(with_categories=true) %}
            {% if messages %}
              {% for category, message in messages %}
                <p class="flashes {{ category }}">{{ message }}</p>
              {% endfor %}
            {% endif %}
          {% endwith %}
      </div>
    </footer>

    <script src="{{url_for('static', filename='js/jquery.slim.min.js')}}"></script>
    <script src="{{url_for('static', filename='js/popper.min.js')}}"></script>
    <script src="{{url_for('static', filename='js/bootstrap.min.js')}}"></script>
  </body>
</html>